package cn.reinforce.util.juhe.model.exp;

import org.apache.commons.lang3.StringUtils;

/**
 * @author 幻幻Fate
 * @date 2019/5/23
 * @since
 */
public enum ExpressStatusDetail {
    PENDING("PENDING", "待查询"),
    NO_RECORD("NO_RECORD", "无记录"),
    ERROR("ERROR", "查询异常"),
    IN_TRANSIT("IN_TRANSIT", "运输中"),
    DELIVERING("DELIVERING", "派送中"),
    SIGNED("SIGNED", "已签收"),
    REJECTED("REJECTED", "拒签"),
    PROBLEM("PROBLEM", "疑难件"),
    INVALID("INVALID", "无效件"),
    TIMEOUT("TIMEOUT", "超时件"),
    FAILED("FAILED", "派送失败"),
    SEND_BACK("SEND_BACK", "退回"),
    TAKING("TAKING", "揽件"),
    ;

    private String status;

    private String detail;

    ExpressStatusDetail(String status, String detail) {
        this.status = status;
        this.detail = detail;
    }

    public String getStatus() {
        return status;
    }

    public String getDetail() {
        return detail;
    }

    public static String getDetailByStatus(String status){
        for (ExpressStatusDetail d : ExpressStatusDetail.values()) {
            if (StringUtils.equals(d.getStatus(), status)) {
                return d.getDetail();
            }
        }
        return null;
    }
}
